﻿using System;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

namespace DirectXSim
{

    public enum ItemType
    {
        None,
        Boost = 1,
        Slippery,
        Stop,
        NoCollision,        
    }

    public class BonusItem
    {
        private Mesh _itemMesh;
        private Vector3 _position;
        private Material _material;
        private ItemType _type;
        private float _radius = 0.4f;

        public BonusItem(Vector3 position, Material material, ItemType type, ref Device dev)
        {
            _position = position;
            _material = material;
            _type = type;
            switch(type)
                {
                case ItemType.Boost:
                        _radius = 0.4f;
                        _itemMesh = Mesh.Torus(dev, 0.1f, 0.4f, 4, 3);
                        break;
                case ItemType.NoCollision:
                        _radius = 0.2f;
                        _itemMesh = Mesh.Teapot(dev);
                        break;
                case ItemType.Slippery:
                        _radius = 0.4f;
                        _itemMesh = Mesh.Sphere(dev, 0.2f, 10, 10);
                        break;
                case ItemType.Stop:
                        _radius = 0.4f;
                        _itemMesh = Mesh.Cylinder(dev, 0.3f, 0.4f, 0.9f, 10, 10);
                        break;
                default:
                        break;

                }
        }

        public Vector3 Position
        {
            get { return _position; }
            //set { _position = value; }
        }

        public Material Material
        {
            get { return _material; }
            //set { _material = value; }
        }

        public ItemType Type
        {
            get { return _type; }
            //set { _type = value; }
        }

        public float Radius
        {
            get { return _radius; }
            //set { _scaling = value; }
        }

        public Mesh ItemMesh
        {
            get { return _itemMesh; }
        }

    }
}
